package com.leyou.item.mapper;

import com.leyou.item.entity.Brand;
import com.leyou.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {
    /**
     * tb_category_brand表新增数据
     * @param bid
     * @param cids
     * @return
     */
    int insertCategoryAndBrand(@Param("bid") Long bid, @Param("cids") List<Long> cids);


    @Select("SELECT * FROM tb_brand WHERE id IN (SELECT brand_id FROM tb_category_brand WHERE category_id = #{id})")
    List<Brand> queryBrandsByCategory(@Param("id") Long id);
}
